package org.gis.utils.beanloader;

import org.gis.mapserver.base.ConfigBean;
import org.gis.mvc.dao.ConfigBeanDAO;
import org.common.base.UniqueID;

/**
 *
 * @author gus
 */
public abstract class ConfigBeanLoader 
{
    protected ConfigBeanDAO  configBeanDAO;

    public ConfigBeanDAO getConfigDAO()
    {
        return configBeanDAO;
    }

    public void setConfigBeanDAO( ConfigBeanDAO configDAO )
    {
        this.configBeanDAO = configDAO;
    }
    
    public ConfigBean loadConfigBean(UniqueID uid) throws Exception
    {
        if( uid == null || uid.isNonValue() )
        {
            throw new IllegalArgumentException("uid");
        }
        return loadBean(uid);
    }
    
    protected abstract ConfigBean loadBean(UniqueID uid) throws Exception;
    
}
